package com.reggielcy.controller;

import com.reggielcy.common.R;
import com.reggielcy.entity.Orders;
import com.reggielcy.service.OrderDetailService;
import com.reggielcy.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @auther teacher
 * @date 2024/3/30
 * @project reggie_take_out
 */
@RestController
@Slf4j
@RequestMapping("/order")
public class OrdersController {
    @Autowired
    private OrderService orderService;
    @Autowired
    private OrderDetailService orderDetailService;

    @PostMapping("/submit")
    public R<String> submit(@RequestBody Orders orders){

        log.info("orders= {}",orders);

        orderService.submit(orders);


        return R.success("下单成功");
    }








}
